home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Risc World 3
/
Risc World 3.iso
/
SOFTWARE
/
ISSUE4
/
POWERBASE
/
DOCS
/
Ch02-Edit
< prev
next >
Wrap
Text File
|
2001-01-25
|
40KB
|
743 lines
===========================
Ch 2 − Browsing and Editing
===========================
When you open a database you will normally see two windows. The record
window displays one data record at a time. Each item of data in the record
occupies a rectangle called a field. The keypad contains buttons for moving
around the database, adding and deleting records, searching for records etc.
It may be toggled between full size and a display of the first two rows of
buttons only. You can also suppress the keypad and put some or all of its
buttons on the record window itself (see 4.2.11). The sample database Boxes
illustrates this. In this chapter we will assume that you are using the
keypad.
Both windows may be moved to whatever position on the screen you find most
convenient and the record window may be re-sized. When you close the
database the position of the keypad and the position and size of the record
window are stored so that they will look the same next time you open the
database.
Most of the keypad functions have keystroke equivalents provided by the
numbered function keys (F1−F11) and experienced users might want to use
these instead of the mouse. The relevant keystrokes are given in the text
where appropriate but note that these are default values and may be
redefined if so desired. Many other actions have equivalent Ctrl sequences
which can’t be redefined. See Appendix B for a complete list.
2.1 Subfiles, record numbers and keys
-----------------------------------------
Look at the title-bar of the record window. Three pieces of information are
displayed; the subfile number, the record number and the key of the record.
Since we will make frequent reference to these three terms it will be as
well to explain at the outset what each one means.
2.1.1 Subfiles
Suppose you have a bookshelf, capable of holding 100 books, and six
partitions, numbered 0−5, which you can use to divide it into sections. The
partitions are, to begin with, all stacked together at the left-hand end of
the shelf. You may leave them like this if you wish and fill up the shelf
with an unbroken run of 100 books. If, however, the books fall into well
defined categories you might prefer to use the partitions to divide the
shelf up into sections. There are no restrictions on where you can place the
partitions, or how many books can fall into each section of shelf, so long
as you don’t exceed a total of 100 books.
In a similar way every Powerbase database is able to use up to six subfiles
numbered 0-5. When you open the database you are looking at subfile 0 and
you might have no occasion to bother with the others at all, in which case
they can be ignored. Like the bookshelf partitions subfiles are there for
you to use or not use depending on what your requirements are. The database
remains the same size whether you use one subfile or all six and the number
of records in a subfile is limited only by the defined size of the database.
Section 2.2.4 suggests instances in which you might find it advantageous to
use more than one subfile.
2.1.2 Record numbers
Every record in the database has a number which specifies its position in a
file called Database. As you step through the records (see 2.2) you will
probably find that the record numbers shown in the title-bar look quite
random. Record numbers reflect the order in which records were originally
entered into the database, not the order in which you see them while
browsing. The latter is determined by the key.
2.1.3 Keys
A key is a group of letters or other characters derived from one or more of
the data fields in a record and used to identify that record. The record
number identifies the record in a sense, of course, but record numbers are
of limited use because they only reflect the order in which the records were
entered. Keys, on the other hand, are derived from the actual data and are
stored in a special table called an index. The keys in the index are
ordered, either alphabetically or numerically and can therefore be used to
examine the records in an order which is related to the data. To use an
analogy with books again, you can look up a key in an index and the index
tells Powerbase what “page” it is on, i.e what is the number of the record
to display.
A database may have several indices built from keys based on different
fields in the record but there must be at least one which we call the
primary key index. When you come to create a database of your own you will
find that Powerbase insists that you define the primary key before you can
use the database. Subsidiary keys may be defined at any time; whether you
use them or not is up to you.
Look at the key field and at the key itself in the title-bar and you will
see that the two are related. You can recognize the key field on which the
- 7 -
currently-active key is based by its descriptor (label) which will be red.
Key fields for other keys have blue descriptors. Non-key fields have black
descriptors. The primary key field is further identified by the background
colour of the data rectangle which is pale yellow instead of white like the
other data fields.
2.2 Moving about the database
---------------------------------
2.2.1 Browsing
Six buttons on the top row of the keypad move you about within the current
subfile. From left to right their actions when clicked on with SELECT are:
Keystroke equivalent
(1) First record Ctrl F1
(2) Previous record F1
(3) 10 records back − “Fast rewind” Shift F1
(4) 10 records forward − “Fast forward” Shift F2
(5) Next record F2
(6) Final record Ctrl F2
The number of records forward or back for actions (3) and (4) is determined
by the number (“Fast forward” interval) in the writable icon between the
associated keypad buttons. The terms first, previous, back, forward, next
and final refer to the order of records as determined by the keys in the
index. The file “wraps around” so after the final record clicking the Next
record button takes you to the first record. If you display the first
record, clicking the Previous record button takes you to the final one. In
accordance with RISC OS conventions clicking with ADJUST instead of SELECT
reverses these actions so that ADJUST over the Next record button, for
instance, takes you to the previous record rather than the next. This allows
you to move about the database with fewer movements of the mouse.
The buttons at the start and end of the second keypad row resemble the Play
and Stop buttons of a tape or video recorder and it will be convenient to
refer to them by these names. Play (F11) causes Powerbase to run through the
records, displaying each one briefly, and Stop (Shift F11) halts the
process. Closing the record window has the same effect as Stop. If Play is
clicked with SELECT records are displayed in forward order. Using ADJUST
displays them in reverse order. You may swap the order at any time by a
further click on Play. The time for which each record remains on screen may
be altered by changing the “Fast forward” interval (see above); the larger
number you type into this icon the longer each record will remain on screen.
At the bottom of the keypad are four “bookmark” icons which let you mark
specific records for rapid retrieval. Click on one with SELECT and the
number of the current record appears in the icon. Clicking with SELECT on a
bookmark icon which contains a record number will return you to that record.
Click with ADJUST to clear the marker.
2.2.2 Moving to related records
If you Shift/double-click on a field with SELECT, and the contents of the
field match the current key of another record, that record will be
displayed. We call this the lookup function. It will also work if a field
contains a comma separated list of keys. Shift/double-click on any one of
these keys takes you to the relevant record. You could experiment with this
using the Elements database. Look up, say, SODIUM, enter in one of the
‘Notes’ fields the primary keys of the other Group 1 metals, i.e.
lith,pota,rubi,caes,fran. You can now access the records of these five
elements from SODIUM’s record.
2.2.3 Changing keys
Two buttons in the middle of the second row of the keypad bear a symbol
resembling a key. They enable you to cycle through the available indices in
opposite directions (Shift F4 and Shift F5 respectively). ADJUST, as usual,
reverses the action of SELECT and “wrap around” again applies. If no
subsidiary indices have been defined these buttons will have no effect.
- 8 -
2.2.4 Changing subfiles
Three buttons in the centre of the third row of the keypad have the
following effect when clicked with SELECT:
(1) Go to previous subfile (F4)
(2) Rotate subfiles (Ctrl F4)
(3) Go to next subfile (F5)
(1) and (3) change the current subfile to the previous one in sequence and
the next in sequence respectively. As with the corresponding buttons for
moving from record to record and key to key Next subfile from subfile 5
takes you to subfile 0 and Previous subfile from 0 takes you to 5. ADJUST
reverses these actions. Rotate renumbers the subfiles so that subfile 0
becomes 1, subfile 1 becomes 2 etc. Subfile 5 becomes 0. Records which were
previously in, for example, subfile 2 will then be found in subfile 3. As
this is quite a drastic change you will be asked to confirm that it’s what
you really want before Powerbase proceeds.
2.2.5 Using more than one subfile
A Powerbase database consists, as stated earlier, of six subfiles numbered
0-5. You may use subfile 0 (which is the one used by default) and ignore the
others if you wish, but there are occasions when users might find two or
more subfiles very useful. If, for example, you are maintaining a set of
pupil records in a school you could assign one subfile to each year. At the
end of a school year the promotion of Year 1 pupils to Year 2, Year 2 to
Year 3 etc can be brought about by a single click on the Rotate button. (In
an 11-16 school this would put the leavers into subfile 0, from which they
could later be removed.)
A more common use of subfiles is to use subfile 0 to hold the in-use records
and subfile 1 as a dumping ground for records which you want out of the way
but don’t want to lose permanently. Powerbase is actually used in this way
in a Further Education college where the applications file for a course is
built up in subfile 0. On enrolment day records are updated to reflect
students’ subject choices and all the records for applicants who have not
appeared are moved into subfile 1. The enrolled students in subfile 0 are
then timetabled and class lists are printed. During the first week of the
course there is a trickle of late enrolments which simply involve retrieving
the required records from subfile 1 and reinstating them in subfile 0.
The facilities for moving records, singly or in batches, from one subfile to
another are described in 2.4.2 and 2.5.6. You can, of course, also select a
subfile and type new records directly into it.
2.2.6 Naming subfiles
To give subfiles meaningful names click MENU over the record window and go
to the Miscellaneous submenu. From there Name subfile leads to a writable
menu item into which you may type a name of up to 20 characters. This then
becomes the name of the current subfile and will be saved on closing the
database.
2.3 Searching for a record
------------------------------
It’s all very well being able to move about the database like flipping
through the pages of a book but how do we find a specific record? Powerbase
provides three ways of doing this: you can search for the record by key, by
record number or by using a filter.
2.3.1 Searching by key
The icon bearing a record card and a question mark is the Search button
(F8). When clicked with SELECT the Search window opens to the right of the
keypad. Type the key of the required record into the writable icon and click
on the Find button or type Return. To see how the key is constructed from
the key field click MENU over the record window and choose Index => Show
details (Ctrl K). This displays a window describing the key structure of the
currently-active index.
If the key exists in the index the record will be found and displayed. If
the key doesn’t exist Powerbase beeps and displays the nearest matching
record with the key field flashing. If the database is a small one with keys
which differ greatly from record to record then the displayed record may not
look to be very near at all. If you typed Return or used SELECT on the Find
button the Search window will be closed. If you want to search repeatedly it
is more convenient to have the window stay on screen and this can be
achieved by clicking on Find with ADJUST. If you do this you will notice
that the icon above the Find button displays the number of matches found.
Clicking on the “bump” icons (the up and down arrowheads) in the Search
window allows you to search an index other than the current one. The index
- 9 -
used affects the search only; clicking the “browse” buttons on the keypad
will show you that the current index has not been changed.
A search carried out as described looks only at the current subfile. If you
suspect that the record you require might be lurking in some other subfile
you can force all six to be searched. This can be achieved by using ADJUST
(Shift F8) instead of SELECT on the keypad Search button. When the Search
window appears you will see that the All subfiles radio button is selected
instead of This subfile. The radio buttons enable you to change your mind
after the window has been opened.
If searching on a numeric key you must enter a number of exactly the right
value. If, however, the key is alphabetic you may use just the first few
letters if they are sufficient to distinguish the key from others.
There are two other buttons on the Search window. Old restores the last key
entered into the writable icon and Cancel simply removes the window from the
screen without further action.
2.3.2 Searching by record number
You may type a record number, preceded by # (e.g. #1054), in the Search
window instead of a key. Provided the record is in use Powerbase will find
and display it, regardless of which subfile it is in. Bear in mind that, if
the record is found in some other subfile than the current one, that subfile
will become the current one. If the record has been deleted or has never
been assigned a “Record #xxx is not in use” message is displayed.
2.3.3 Searching by filter
The Filter switch (Ctrl F8) is in the middle of the last row on the keypad.
Selecting it brings up the Filter window which contains a writable icon into
which you can type a search formula (see 3.4). You should then click on the
Filter button in the Filter window or, alternatively, type Return. The
keypad buttons used for browsing will now only display records which match
the search formula, all non-matching records being filtered out. Deselecting
the Filter switch closes the Filter window and restores normal keypad
operation. So does clicking Cancel on the Filter window. The Close button
simply closes the Filter window but leaves the filter in effect − useful if
you want the window out of the way once you’ve set up a filter.
2.4 Editing the database − fundamental operations
-----------------------------------------------------
2.4.1 Adding new records
The icon bearing a record card and a plus sign is the Add record button
(F10). Clicking with SELECT displays a blank record for you to fill in. The
subfile number and anticipated record number are shown in the title-bar of
the record window but there is, of course, no key as yet because there is no
data. The title-bar therefore reads “(New)” in the place where the key
normally appears. In most databases you may leave blank any fields except
the primary key field.† Powerbase does, however, allow other fields to be
defined as mandatory fields. If the database contains such fields (which
normally have red as their foreground colour) you will be told about them
when you try to move to another record or close the database and will be
unable to do so until you fill them in. You might also find that on some
fields pressing certain keys has no effect. This will happen, for example,
if you try to type letters into a field which has been defined as Numeric.
If you type into a field whose text and border are dark green you may get an
error message. These fields only accept certain values which are listed in a
validation table (see 5.2). To see what these values are make sure the caret
is in the relevant field then click on the List values button on the
keypad.
After entering data into a field you can go to the next field in sequence by
typing either the Return or the down-arrow key⇩. To go back one field use
the up-arrow key⇧. These arrow keys work in such a way that attempting to go
beyond the last field of the record takes you to the first field and
attempting to go back from the first field takes you to the last. Typing
Return on the last field of a record acts rather differently in that it
writes the record to disc and brings up a new blank record for editing, i.e.
it duplicates the action of the Add record button on the keypad. You can, in
addition, place the caret in any editable field by clicking with SELECT.
When you have entered as much of a record as you wish you can click Add
record again for another blank record. The record you have just entered is
automatically written to the database. The same is true if you click on any
- 10 -
other keypad button or close the database altogether. You don’t need to use
the Force update (F3) button to tell Powerbase to write the record. The
real purpose of this button is to make Powerbase save indices and validation
tables which are stored in memory. Occasional use of the button during a
long working session guards against power cuts or system failure.
2.4.2 Deleting records
The fourth row of the keypad has only three buttons, the middle one of which
suggests putting an index card in a dustbin. This is obviously the Delete
button (Ctrl F10) but what are the others? The left button (F6) moves the
displayed record back one subfile, i.e. if the record is in subfile 1 it
will be moved to subfile 0. If it is in subfile 0 it will be moved into
subfile 5 (“wrap-around” again). The right button (F7) moves the record
forward one subfile. A record in subfile 5 will be moved into subfile 0.
These buttons, which we will refer to as Shift back and Shift forward
respectively, clearly don’t delete records at all, except in the sense
“delete from the current subfile”. We often want to get a record out of our
way but keep open the option of bringing it back again and that’s where
these buttons are really useful. If you have a lot of records in subfile 0
and want to do a clear-out you can use subfile 1 as a dumping-ground for the
unwanted records. You’re not really deleting them: just removing them from
the subfile you’re working in.
It is sometimes useful when shifting a record, to be able to “follow” it
into its new subfile. You can do so by holding down SHIFT while you click on
the Shift forward or Shift back button.
The Delete (dustbin) button should only be used when you are sure you want
to lose the record permanently. As this is quite a drastic action Powerbase
will ask you to confirm it before the record actually disappears. Nervous
users may prefer to leave this button strictly alone and do all their
“deleting” with Shift forward. If this eventually results in a lot of
clutter in the subfile next to the one you’re using you can always do an
occasional clear-out as described in 2.5.7.
2.4.3 Altering existing records
A displayed record may be altered manually without any restrictions other
than those applying to the addition of new records (see 2.4.1). Alterations
which would result in a change to the primary key must be confirmed. Normal
RISC OS conventions for editing writable icons apply, e.g. Ctrl U clears the
icon. As with new record entries you need do nothing to save your changes to
disc. The process takes place automatically before a different record is
displayed, when a database is closed or on quitting Powerbase.
2.4.4 Undoing mistakes
Changes to the record on-screen can be undone provided you haven’t clicked
on Force update (not normally needed anyway) or done anything to cause
Powerbase to display a different record. In other words, you can undo
changes made to the current record as long as it remains on the screen. You
may either undo all the alterations made to the record or only those
relating to specific fields.
If you bring up the main menu and choose Undo changes the record will be
returned to the state it was in when you displayed it and before you began
to edit it. To restore an individual field, click MENU over the field then
go to the Field submenu and choose Undo changes from there. Only ordinary
writable fields and check boxes may be restored; you can’t restore External
fields (see 2.6) which is why a warning is normally issued before deleting
such fields.
2.5 Editing the database − special features
-----------------------------------------------
Section 2.4 described all the editing facilities you actually need in order
to maintain your database. The features described in this section are not
essential but they can save you time and make your use of the database more
efficient.
2.5.1 Using a template
You may want certain fields to be filled in with fixed contents on every new
record to save typing the same thing every time and Powerbase provides a
means of doing this. Call up the main menu, go to the Miscellaneous submenu
and choose Edit template. A blank record is displayed and the window title
says “Enter data which you wish to appear by default on new records”. Type
in the required fixed data then click any of the usual keypad buttons. You
will now find that the new record displayed every time you click Add record
is no longer blank but already contains the data entered in your template.
This feature affects new records only; it doesn’t have a retrospective
effect on existing records.
- 11 -
2.5.2 Copying fields
The buttons at the far left and right of the third row of the keypad may be
thought of as Copy to Clipboard (Ctrl C) and Paste from Clipboard (Ctrl V)
respectively. They can save a lot of time when you want to copy data from
one field into another. When you click SELECT on Copy, the contents of the
field which owns the caret is stored in memory. Positioning the caret in
another field and clicking on Paste will copy the stored data into the new
field, erasing the field’s previous contents (if any). If the data is too
long for the field it will be truncated. If there is nothing on the
clipboard the corresponding data from the previously-displayed record will
be copied to the field. Copy and Paste are not limited to copying into
another field of the same record; you may use them to copy data between
records or from a record into a validation table or a dialogue box or,
indeed, between any two writable icons within Powerbase. Data remains on the
clipboard until you use Copy again.
If you have highlighted fields using ADJUST as if for printing (see 3.3)
clicking SELECT on the Add record button displays the new record with all
the highlighted data from the previously-displayed record already entered.
To prevent the accidental creation of unwanted records primary key fields
are not copied in this way. (Remember that a record will not be added to
the database if the primary key field is blank.)
This is a suitable place to explain how Powerbase can also copy data to and
from other applications by means of the global clipboard. The latter is a
feature of RISC OS which few users seem to know about and not all
applications use it. Here’s how it works. Highlight one or more fields with
ADJUST as described above and make sure the caret is in the displayed
record. It needn’t be in one of the highlighted fields; any field will do.
Now type Ctrl Shift C. Nothing appears to have happened but the highlighted
data is now on the global clipboard. If you open, say, an Impression window,
place the caret in it and type Ctrl V the data will be copied to Impression.
If, on the other hand, you highlight data in Impression and type Ctrl C,
then place the caret in a Powerbase record and type Ctrl Shift V the data
will be copied from Impression to Powerbase. The same method may be used to
copy data from Powerbase to Writer, Easywriter or Techwriter. For StrongEd
you need to type Ctrl Shift V. Although copying in the reverse direction
works fine with Impression it does not appear to work with these other
applications. Edit doesn’t appear to support the global clipboard at all.
2.5.3 Copying an entire record
When a new record contains much of the same information as an existing one
you can save time by copying a whole record and editing the copy. Display
the record you want to copy and then click the Add record button with ADJUST
instead of SELECT (Shift F10). No blank record appears when you do this;
instead an exact copy of the current record is displayed and a message
appears informing you of this. If you make no changes to the copy Powerbase
will not add the new record to the database. (It is assumed that no-one
will ever want two absolutely identical records in the same database!) Any
alteration, however, leads to the record becoming part of the database.
2.5.4 Choosing the field where editing starts
When an existing or blank record is displayed Powerbase places the caret in
the first (i.e. lowest-numbered) writable field of the record. This might
not necessarily look like the first if the fields have been placed in
out-of-sequence positions in the window. When going through a database
making changes to one or two fields somewhere in the middle of records it
might be convenient to have the caret start somewhere else. Click MENU over
the field where you wish the caret to start, go to the Field submenu and
choose Start editing. Whenever a record is displayed the caret will be
placed in the chosen field. The same procedure is used to restore the normal
starting position.
2.5.5 Changing many records at once
To alter a given field in a set of records point the mouse at the field and
click MENU. Go to the Field submenu and choose Global changes. In the first
writable icon (Replace) enter what you want changing and in the second
(with) enter what you want the field changing to. In the third you may enter
a search formula (see 3.4) specifying which records are to be changed.
Finally click on Change or type Return. Note the following:
• Only records in the current subfile are affected.
• Replacement only occurs if the new data will fit in the field.
- 12 -
• Leaving Replace blank causes the target field to be replaced in any
record which matches the search formula, otherwise replacement
occurs only where the existing field matches the Replace string.
• Leaving with blank causes the target field to be blanked in records
which match the search formula and in which the target field matches
the Replace string.
• Leaving the search formula blank causes replacement to occur in all
records of the current subfile for which the target field matches
the Replace string.
It should be apparent from the above that leaving both Replace and the
Search formula blank will place the with string in all records of the
current subfile. Since this is a rather drastic facility you will be asked
for confirmation before the changes go ahead.
The characters “$” and “#” may be used as “wild-card” characters in the
Replace and with strings.* The first of these is used to represent a group
of characters which don’t need to be matched. If you enter:
Replace $Street with $Road
the substitution will be performed on any record which matches the search
formula and where the target field ends with “Street”. The ending will be
changed to “Road” leaving the rest of the string unchanged. Another example
of use is:
Replace 47$ with 1047$
If the target field begins with “47”, the beginning will be changed to
“1047”, the remainder left unaltered.
Replace $MPUT$ with $NFUS$
would change “MPUT” occurring anywhere in the target field into “NFUS”, e.g.
“COMPUTER” would become “CONFUSER”(!). You may, of course, use “$” in the
middle of a word:
Replace re$ment with dis$d
would cause a string in the target field beginning with “re” and ending with
“ment” to have its head and tail replaced with “dis” and “ed”, leaving the
middle unchanged. e.g. “replacement” would become “displaced”.
The “#” character is used to represent a single wild-card character and can
replace individual letters in specific positions. The Replace and with
strings must be the same length and should have “#” characters in the same
positions. The characters in the remaining positions are the ones which get
replaced, but only if they occur in the corresponding positions of the
existing field value.
You may also use Global changes to perform simple calculations e.g. “+12”
in with will add 12 to the current value in the field on all the matching
records. “*5-13” will multiply the current value by 5 and then subtract 13.
It is operations like these which are most likely to produce values which
won’t fit in the field, especially if floating-point numbers are involved.
The operation isn’t limited to Numeric fields, or even to other types of
field consisting wholly of numerals; Powerbase will find the number embedded
in an entry such as “ABC45XYZ” and the operation “+12” would convert it to
“ABC57XYZ”.
2.5.6 Moving or deleting many records at once
Choose Move/delete from the Miscellaneous submenu. This opens a window which
gives you the choice of three types of operation:
(a) Delete records from a designated subfile
(b) Accumulate records from all subfiles into one designated subfile
(c) Move records from one designated subfile to another
The default is to Move records from the current subfile to the next in
sequence, but any source or destination subfile may be specified by clicking
on the bump-icons. Type in a search formula (see 3.4) and click the default
action button or type Return. All matching records will be moved or deleted
as specified. Operations by clicking on the Undo button, but only for the
last operation carried out.
2.5.7 Hiding sensitive data
Your database might contain information which you don’t want just anyone to
read. A field may be hidden by placing the caret in it and typing Ctrl Shift
F9. The text changes from black to mid-grey to tell you that something has
been done to it. If you subsequently type Ctrl Shift F2 all such fields
will vanish. You can make them reappear (in mid grey) with Ctrl Shift F1 but
- 13 -
they will always be invisible when the database is first opened. Ctrl Shift
F9 has a toggle action: repeating the operation on a field removes the
protection.
Whilst in the invisible state a field cannot be selected for printing (see
3.3). ADJUST has no effect and you can’t sneak round the protection by using
Ctrl A to select all fields or by choosing a range containing the hidden
field (i.e. by clicking with SELECT on an earlier field then double-clicking
with ADJUST on a later one). Its tag doesn’t appear in the Field entry of
the main menu when you click MENU in the relevant place, nor does the field
appear in the field list produced by typing Ctrl F. As soon as you reveal
the data by typing Ctrl Shift F1 it can be printed as normal.
If you intend to use this facility you are strongly urged to password-
protect your database (see Ch 11). Only a user with Manager access rights
will then be able to use Ctrl Shift F1, F2 and F9. If you leave the
database unprotected then anyone can use the key combinations and might
easily discover them by chance (or by reading this manual!).
2.6 External fields
-----------------------
The data in External fields is not stored within the Database file but in
separate files, one for each record. With the exception of Remote fields
these files are stored inside the database’s application directory. They
may be Text, Sprite or Draw files and can be linked to buttons on the record
window. Clicking on these buttons loads the External file into Edit, Paint
or Draw provided that the relevant program has been “seen” by the filer.
(For Remote fields the file objects can be of any type whatsoever including
applications and directories and clicking on the button performs the
appropriate action, e.g. an application is run, a directory is opened, an
Obey or Basic file is executed, other files are loaded into the appropriate
editor if the filer knows where it is. Remote fields are discussed fully in
Ch 4.)
It is also possible to link Text files to a Text block field which will
actually display the text (with certain limitations) within a large icon.
Sprites may be similarly displayed in a Picture field.
2.6.1 Linking files to the fields
To link a file with an External field drag the file’s icon onto the record
window and drop it on the appropriate field. For example, if the record
includes a field represented by a Text button, i.e. one bearing a small
version of the Edit icon, you may drop a Text file onto it. The button’s
icon changes to the small version of the Text file icon to indicate that the
file has been linked. Sprite and Draw files are linked in the same way and
Powerbase will not allow the wrong type of file to be linked. A Text block
field also may have a Text file dropped onto it.* The text (or as much of it
as will fit inside the icon) is then displayed on the record window. The
formatting will not be the same as it is when you examine the text in Edit;
lines are word-wrapped and centred within the display icon. (This is a
feature of multi-line RISC OS text icons and is out of the control of
Powerbase.) You can’t edit the text directly but it is possible to export
the file for editing (see below). Sprite files may be dropped onto and
displayed in a Picture field. Any new file dropped onto an External field
which is already linked to a file simply replaces the old file with the new.
2.6.2 Editing External fields
You can’t edit an External field directly, only via an appropriate editing
program such as Edit, Paint or Draw. As long as the editor has been “seen”
by the filer clicking on the on-screen button with SELECT will load the file
into the editor and display it. You can edit the file and re-save it without
altering its name and it will remain associated with the same field of the
record. Text block and Picture files are loaded into their editors by a
double click.
2.6.3 Clearing and exporting field contents
Clicking MENU over an External field makes available certain entries on the
Field submenu which are shaded for other types of field. Remove external
lets you delete the linked file from the database application.† As deleting
a file is rather drastic you would probably like to be warned when this is
about to happen so the message “Delete object? Are you sure?” normally
appears. Finally, Save contents on the Field submenu lets you export the
linked field to a filer window or to another application.
- 14 -
2.6.4 Editing scrollable lists
Entering or altering data in a scrollable list is not very different from
doing so in other types of field, but some keys do behave differently and
there are extra keystrokes to access the special features of such lists.
Return moves the caret from cell to cell across the current row, then jumps
to the start of the next row. When it reaches the last visible cell the list
will scroll up a row if there are still rows to display. If the last cell of
the list has been reached the caret moves to the next field or next record,
just as it does for other types of editable field.
Shift-Return behaves like Return until the last cell of the list is reached.
It then adds a row to the list, moving the caret to the start of the new
row. You may add as many rows as you wish and each record can have a
different number of rows.
Insert with the caret anywhere in the list also adds a row to the end, but
this time without scrolling the list or moving the caret. There is (at
present) no way of inserting a blank row into the middle of the list.
Shift-Insert is used to remove unwanted blank rows. (Not Shift-Delete, as
you might expect because this will have the same effect on characters as
Delete!) This key-combination is quite safe: it will only delete when the
caret is in the last row and only if that row is blank.
Ctrl-Shift-Insert will force the deletion of whatever row the caret is in.
You aren’t very likely to use this accidentally.
Neither Shift-Insert nor Ctrl-Shift-Insert will let you delete rows so that
the number is fewer than the window can display: when the scroll-bar
completely fills its slot this minimum has been reached.
Up and Down arrows move the caret vertically from cell to cell, staying in
the same column. When at the top or bottom of the list wrap-around occurs
instead of the caret moving to the previous or following field as it does
for other field types.
Wiping a scrollable list
------------------------
Click MENU over the list and go to the Field submenu. Choose Blank list. You
will be asked for confirmation before the data is deleted.
Data export and import
----------------------
When MENU is clicked over a scrollable list two choices become available on
the Field submenu in addition to Blank list noted above:
Save as list saves the contents of the scrollable list as a plain text file.
The contents of each cell of the list occupies a separate line and there is
nothing in the file to indicate which items came from the same row and which
came from different rows. If such a list is dropped onto a scrollable list
field the data will be imported cell by cell, working along each row to the
end and then moving to the next.
Save as CSV saves the list as a CSV file (see Ch 8) with each row of the
list as a separate CSV record and each cell in the row as a CSV field. The
characteristics of the file are determined by the CSV Options window just as
they are for exporting data from ordinary fields.
If you drop such as CSV file onto a scrollable list field the result is
somewhat different from the importing of a text list as described above
because the data in the file is more structured; the row and column
information of the field from which the data came has been retained.
Suppose you have exported such a file from a 3-column scrollable list. If
you drop the file onto a 2-column list the third item in each line of the
file will be ignored: the destination field will contain what the first two
columns of the source field contained. If, on the other hand, you drop the
file onto a 4-column scrollable list the 4th column of the list will be left
blank.
- 15 -